package org.eclipselabs.egf.portfolio.task.scala.test.bool

import org.eclipse.core.runtime.IProgressMonitor
import org.eclipse.egf.core.EGFCorePlugin
import org.eclipse.egf.core.producer.InvocationException
import org.eclipse.egf.ftask.producer.context.ITaskProductionContext
import org.eclipse.egf.ftask.producer.invocation.ITaskProduction
import java.lang.Boolean

class BoolShow extends ITaskProduction{
	
	def preExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor ) ={
	}
	
	def doExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
		var first = taskProductionContext.getInputValue("firstBooleanShow", classOf[Boolean])
		var second = taskProductionContext.getInputValue("secondBooleanShow", classOf[Boolean])
		var out = taskProductionContext.getInputValue("thirdBooleanShow", classOf[Boolean])
		EGFCorePlugin.getDefault().logInfo("first boolean : \t\t" + first)
		EGFCorePlugin.getDefault().logInfo("second boolean : \t\t" + second)
		EGFCorePlugin.getDefault().logInfo("first AND second : \t" + (first && second))
		EGFCorePlugin.getDefault().logInfo("first OR second : \t\t" + (first || second))
		EGFCorePlugin.getDefault().logInfo("first XOR second : \t" + (first ^ second))
		if(out != null)
			EGFCorePlugin.getDefault().logInfo("first == second : \t\t" + out)
		else
			EGFCorePlugin.getDefault().logInfo("first == second : \t\t" + (first == second) + " (dynamically calculated)")
		
	}
	
	def postExecute(taskProductionContext:ITaskProductionContext , monitor:IProgressMonitor )={
	}
}